package com.tong.hao.ac.service.controller.account;

import cn.buddha.jec.flowable.FlowableExecute;
import cn.buddha.jec.util.TongUtils;
import com.tong.hao.ac.api.model.in.account.AC020001Req;
import com.tong.hao.ac.api.model.out.account.AC020001Res;
import com.tong.hao.ac.api.service.account.IAC020001;
import com.tong.hao.ac.service.flowable.account.AcUserFlowable;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @ClassName AC020001
 * @Author 友野浩二
 * @Date 2020/5/2 22:16
 * @Description 用户注册
 * @Version 1.0
 */
@Api(tags = "用户注册")
@RestController
@Slf4j
public class AC020001 implements IAC020001 {

    /**
     * 服务流程启动类
     */
    @Resource
    private FlowableExecute flowableExecute;

    /**
     * @return com.tong.hao.ac.api.model.out.account.AC020001Res
     * @Author 友野浩二
     * @Description // 用户注册
     * @Date 2020/5/2 22:19
     * @Param [ac020001Req]
     */
    @Override
    @ApiOperation(value = "用户注册")
    @RequestMapping(value = TONG_HAO_AC_02_0001, method = RequestMethod.POST)
    public AC020001Res recordUser(@RequestBody AC020001Req ac020001Req) {
        return this.flowableExecute.start(TongUtils.lowerFistChar(AcUserFlowable.class.getSimpleName()), ac020001Req);
    }
}
